package mi.payment.db.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import mi.payment.db.dao.PayDetail;
import mi.payment.db.dao.PaySettlement;
import mi.payment.db.dao.UserInfo;

import mi.payment.db.dao.PayDetailDao;
import mi.payment.db.dao.PaySettlementDao;
import mi.payment.db.dao.UserInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig payDetailDaoConfig;
    private final DaoConfig paySettlementDaoConfig;
    private final DaoConfig userInfoDaoConfig;

    private final PayDetailDao payDetailDao;
    private final PaySettlementDao paySettlementDao;
    private final UserInfoDao userInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        payDetailDaoConfig = daoConfigMap.get(PayDetailDao.class).clone();
        payDetailDaoConfig.initIdentityScope(type);

        paySettlementDaoConfig = daoConfigMap.get(PaySettlementDao.class).clone();
        paySettlementDaoConfig.initIdentityScope(type);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        payDetailDao = new PayDetailDao(payDetailDaoConfig, this);
        paySettlementDao = new PaySettlementDao(paySettlementDaoConfig, this);
        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);

        registerDao(PayDetail.class, payDetailDao);
        registerDao(PaySettlement.class, paySettlementDao);
        registerDao(UserInfo.class, userInfoDao);
    }
    
    public void clear() {
        payDetailDaoConfig.clearIdentityScope();
        paySettlementDaoConfig.clearIdentityScope();
        userInfoDaoConfig.clearIdentityScope();
    }

    public PayDetailDao getPayDetailDao() {
        return payDetailDao;
    }

    public PaySettlementDao getPaySettlementDao() {
        return paySettlementDao;
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

}
